﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VonaJobs.BLL;
using VonaJobs.DAL.DAO;

namespace VonaJobs.UI.Admin
{
    public partial class CreateMemberShipType : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public void  CreateNewMemberShipPolicy(object sender,EventArgs eventArgs)
        {
            try
            {
                Policy policy = new Policy();
                MemberType memberType = new MemberType();
                memberType.Id = Convert.ToInt32(selectMembershipType.Value);

                policy.PolicyName = txtPolicyName.Value;
                policy.DiscountAmount = Convert.ToDecimal(txtDiscountAmount.Value);
                policy.FreePostingDay = Convert.ToInt32(txtFreePostingDay.Value);
                policy.Description = txtMembershipDetails.Value;
                policy.NumberofJobQuota = Convert.ToInt32(txtMaximumJobQuota.Value);
                policy.MemberType = memberType;
                PolicyManager policyManager = new PolicyManager();
                string msg = policyManager.SaveNewPolicy(policy);
            }
            catch (Exception)
            {
                
                throw;
            }
           

        }
    }
}